function loadData<T>(data: T){
    console.log('data', data)
}

loadData<number>(1)

loadData<string>('1')


function loadData2<T, U>(data: T, data2: U){
    console.log('data', data)
}

loadData2<number, boolean>(1, true)

loadData2<string, number>('1', 1)



function loadData3<T, U>(data: T, data2: U): T | U {
    console.log('data', data)
    return Date.now() % 2 ? data : data2
}

loadData3<number, boolean>(1, true)

loadData3<string, number>('1', 1)